package ${packageName}.dao;

import java.util.List;
import cn.com.gc.core.mybatis.crud.CommonCrudMapper;

import org.apache.ibatis.annotations.*;
import ${packageName}.model.${name};
/**   
 * @Title: ${name}WebDao.java
 * @Description: ${description}的数据交互类
 * @author ${author}
 * @date   ${newdate}
 * @version V1.0.0
 * ----------------------------------------------------------------------------
 *  modifyer    modifyTime                 comment
 *
 * ----------------------------------------------------------------------------
 *
 */
public interface ${name}WebDao extends CommonCrudMapper<${name}> {
    @Select("<script> " +
    "select * from  ${tableName} where status='1' and enable_status='1' and ${pkColumn} in " +
    "<foreach item='item' index='index' collection='idList' open='(' separator=',' close=')'> " +
    "${item} " +
    "</foreach> " +
    "</script>")
    @Results(
        id="${nameLower}",
        value = {
            ${results}
        }
    )
    List<${name}> getSysRoleMenuByRoleCodeList(@Param("idList") List<${pkType}> idList);
    /**
     * @Title: 删除${description}信息
     * @Description:id @{Link Long[]}
     * @param
     * @return
     * @throw
     * @author ${author}
     * @date ${newdate}
     *  --------------------------------------------------------
     *  modifyer    modifyTime                 comment
     *
     *  --------------------------------------------------------
     */
    @Update("<script> " +
            "UPDATE ${tableName} set status='0'"+
            "WHERE ${pkColumn} IN " +
            "<foreach item='item' index='index' collection='idList' open='(' separator=',' close=')'> " +
            "${item} " +
            "</foreach> " +
            "</script>")
    void del(@Param("idList") List<${pkType}> idList);
    /**
     * @Title: 禁用${description}信息
     * @Description:id @{Link Long}
     * @param
     * @return
     * @throw
     * @author ${author}
     * @date ${newdate}
     *  --------------------------------------------------------
     *  modifyer    modifyTime                 comment
     *
     *  --------------------------------------------------------
     */
     @Update("<script> " +
             "UPDATE ${tableName}  " +
             "SET ${pkColumn} = ${enableStatus}  " +
             "WHERE user_id IN " +
             "<foreach item='item' index='index' collection='idList' open='(' separator=',' close=')'> " +
             "${item} " +
             "</foreach> " +
             "</script>")
     void updateEnableStatus(@Param("enableStatus") String enableStatus, @Param("idList") List<${pkType}> idList);
}